package com.kaili.client.service.Impl;

import com.kaili.client.service.ILoginUserInfoService;
import com.kaili.common.entity.LoginDetail;
import com.kaili.common.util.LoginDetailUtils;
import org.springframework.stereotype.Service;

@Service
public class LoginUserInfoService implements ILoginUserInfoService {
    @Override
    public Integer getLoginUserId() {
        Integer userId = LoginDetailUtils.getCurrentEmployeeId();
        if(userId == null){
            return 0;
        }
        return userId;
    }

    @Override
    public Integer getLoginSiteId() {
        LoginDetail loginDetial = LoginDetailUtils.getCurrent();
        if(loginDetial!=null){
            return LoginDetailUtils.getCurrent().getSiteId();
        }

        return 0;
    }
}
